<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:binding="http://schemas.android.com/apk/res-auto">

    <data>

        <import type="android.view.View" />

        <variable
            name="viewModel"
            type="cn.eoneplus.mes.ui.module.verification.${classname}.${ClassName}ViewModel" />
    <#if isCardView>
        <variable
            name="adapter"
            type="cn.eoneplus.mes.ui.module.verification.${classname}.${ClassName}RecyclerViewBindingAdapter" />

        <import type="cn.eoneplus.app.common.binding.viewadapter.recyclerview.LayoutManagers" />

        <import type="cn.eoneplus.app.common.binding.viewadapter.recyclerview.LineManagers" />
    </#if>

    </data>

    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

        <include xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:binding="http://schemas.android.com/apk/res-auto"
            android:id="@+id/call_material_top"
            layout="@layout/layout_toolbar"
            binding:toolbarViewModel="@{viewModel.toolbarViewModel}" />

        <View style="@style/DividerView" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginLeft="@dimen/dimen_10"
            android:layout_marginTop="@dimen/dimen_10"
            android:layout_marginRight="@dimen/dimen_10"
            android:orientation="vertical">

        <#if childDTOListFlsg != "0">
        <#list childDTOList as child>
            <#if child.type == "输入框">
            <!-- ${child.nameCN} -->
            <LinearLayout style="@style/InputItemShortLinearLayout">

                <ImageView
                    style="@style/InputItemImageView"
                    android:background="@mipmap/cm_workorder" />

                <TextView
                    style="@style/ShowMainTextView_margin_small"
                    android:layout_width="@dimen/dimen_0"
                    android:layout_weight="1"
                    android:singleLine="true"
                    android:text='${child.nameCN}' />

                <EditText
                    style="@style/InputItemEdiText"
                    android:layout_weight="5"
                    android:hint="${child.nameCN}"
                    android:text="@={viewModel.${child.name}}" />

            </LinearLayout>
            </#if>
            <#if child.type == "下拉框">
                <!-- ${child.nameCN} -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="@dimen/dimen_50"
                android:background="@color/white"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="@dimen/dimen_80"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:gravity="center_vertical"
                    android:paddingLeft="@dimen/common_padding"
                    android:singleLine="true"
                    android:text='${child.nameCN}'
                    android:textColor="@color/textColor"
                    android:textSize="@dimen/text_size_12" />

                <Spinner
                    android:layout_width="@dimen/dimen_0"
                    android:layout_height="match_parent"
                    android:layout_weight="3"
                    android:textSize="@dimen/text_size_12"
                    binding:itemDatas="@{viewModel.${child.name}ItemData}"
                    binding:onItemSelectedCommand="@{viewModel.on${child.name}SelectorCommand}" />

                </LinearLayout>
            </#if>
            <#if child.type == "按钮">
            <Button
                style="@style/ButtonConfirmOk"
                android:layout_width="match_parent"
                android:layout_height="@dimen/dimen_45"
                android:layout_gravity="center"
                android:layout_margin="@dimen/common_margin"
                android:text='${child.nameCN}'
                binding:onClickCommand="@{viewModel.${child.name}ClickCommend}" />
            </#if>
        </#list>
        </LinearLayout>
    </#if>
        <#if isCardView>
        <View style="@style/DividerView" />

        <!-- 卡片布局 配料信息 -->
        <LinearLayout style="@style/VerificationListWrap">
            <androidx.recyclerview.widget.RecyclerView
                style="@style/VerificationListPartWrap"
                binding:adapter="@{adapter}"
                binding:itemBinding="@{viewModel.listItemBinding}"
                binding:items="@{viewModel.itemList}"
                binding:layoutManager="@{LayoutManagers.linear()}"
                binding:lineManager="@{LineManagers.horizontal()}" />
        </LinearLayout>
        </#if>

    </LinearLayout>

</layout>